//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2024 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto-codegenerator.
// DO NOT EDIT.

#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif
@_exported import SotoCore

/// Service object for interacting with AWS PcaConnectorAd service.
///
/// Amazon Web Services Private CA Connector for Active Directory creates a connector between Amazon Web Services Private CA and Active Directory (AD) that enables you to provision security certificates for AD signed by a private CA that you own. For more information, see Amazon Web Services Private CA Connector for Active Directory.
public struct PcaConnectorAd: AWSService {
    // MARK: Member variables

    /// Client used for communication with AWS
    public let client: AWSClient
    /// Service configuration
    public let config: AWSServiceConfig

    // MARK: Initialization

    /// Initialize the PcaConnectorAd client
    /// - parameters:
    ///     - client: AWSClient used to process requests
    ///     - region: Region of server you want to communicate with. This will override the partition parameter.
    ///     - partition: AWS partition where service resides, standard (.aws), china (.awscn), government (.awsusgov).
    ///     - endpoint: Custom endpoint URL to use instead of standard AWS servers
    ///     - middleware: Middleware chain used to edit requests before they are sent and responses before they are decoded 
    ///     - timeout: Timeout value for HTTP requests
    ///     - byteBufferAllocator: Allocator for ByteBuffers
    ///     - options: Service options
    public init(
        client: AWSClient,
        region: SotoCore.Region? = nil,
        partition: AWSPartition = .aws,
        endpoint: String? = nil,
        middleware: AWSMiddlewareProtocol? = nil,
        timeout: TimeAmount? = nil,
        byteBufferAllocator: ByteBufferAllocator = ByteBufferAllocator(),
        options: AWSServiceConfig.Options = []
    ) {
        self.client = client
        self.config = AWSServiceConfig(
            region: region,
            partition: region?.partition ?? partition,
            serviceName: "PcaConnectorAd",
            serviceIdentifier: "pca-connector-ad",
            serviceProtocol: .restjson,
            apiVersion: "2018-05-10",
            endpoint: endpoint,
            errorType: PcaConnectorAdErrorType.self,
            middleware: middleware,
            timeout: timeout,
            byteBufferAllocator: byteBufferAllocator,
            options: options
        )
    }





    // MARK: API Calls

    /// Creates a connector between Amazon Web Services Private CA and an Active Directory. You must specify the private CA, directory ID, and security groups.
    @Sendable
    @inlinable
    public func createConnector(_ input: CreateConnectorRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateConnectorResponse {
        try await self.client.execute(
            operation: "CreateConnector", 
            path: "/connectors", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Creates a connector between Amazon Web Services Private CA and an Active Directory. You must specify the private CA, directory ID, and security groups.
    ///
    /// Parameters:
    ///   - certificateAuthorityArn:  The Amazon Resource Name (ARN) of the certificate authority being used.
    ///   - clientToken: Idempotency token.
    ///   - directoryId: The identifier of the Active Directory.
    ///   - tags: Metadata assigned to a connector consisting of a key-value pair.
    ///   - vpcInformation: Information about your VPC and security groups used with the connector.
    ///   - logger: Logger use during operation
    @inlinable
    public func createConnector(
        certificateAuthorityArn: String,
        clientToken: String? = CreateConnectorRequest.idempotencyToken(),
        directoryId: String,
        tags: [String: String]? = nil,
        vpcInformation: VpcInformation,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateConnectorResponse {
        let input = CreateConnectorRequest(
            certificateAuthorityArn: certificateAuthorityArn, 
            clientToken: clientToken, 
            directoryId: directoryId, 
            tags: tags, 
            vpcInformation: vpcInformation
        )
        return try await self.createConnector(input, logger: logger)
    }

    /// Creates a directory registration that authorizes communication between Amazon Web Services Private CA and an Active Directory
    @Sendable
    @inlinable
    public func createDirectoryRegistration(_ input: CreateDirectoryRegistrationRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateDirectoryRegistrationResponse {
        try await self.client.execute(
            operation: "CreateDirectoryRegistration", 
            path: "/directoryRegistrations", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Creates a directory registration that authorizes communication between Amazon Web Services Private CA and an Active Directory
    ///
    /// Parameters:
    ///   - clientToken: Idempotency token.
    ///   - directoryId:  The identifier of the Active Directory.
    ///   - tags: Metadata assigned to a directory registration consisting of a key-value pair.
    ///   - logger: Logger use during operation
    @inlinable
    public func createDirectoryRegistration(
        clientToken: String? = CreateDirectoryRegistrationRequest.idempotencyToken(),
        directoryId: String,
        tags: [String: String]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateDirectoryRegistrationResponse {
        let input = CreateDirectoryRegistrationRequest(
            clientToken: clientToken, 
            directoryId: directoryId, 
            tags: tags
        )
        return try await self.createDirectoryRegistration(input, logger: logger)
    }

    /// Creates a service principal name (SPN) for the service account in Active Directory. Kerberos authentication uses SPNs to associate a service instance with a service sign-in account.
    @Sendable
    @inlinable
    public func createServicePrincipalName(_ input: CreateServicePrincipalNameRequest, logger: Logger = AWSClient.loggingDisabled) async throws {
        try await self.client.execute(
            operation: "CreateServicePrincipalName", 
            path: "/directoryRegistrations/{DirectoryRegistrationArn}/servicePrincipalNames/{ConnectorArn}", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Creates a service principal name (SPN) for the service account in Active Directory. Kerberos authentication uses SPNs to associate a service instance with a service sign-in account.
    ///
    /// Parameters:
    ///   - clientToken: Idempotency token.
    ///   - connectorArn:  The Amazon Resource Name (ARN) that was returned when you called CreateConnector.
    ///   - directoryRegistrationArn: The Amazon Resource Name (ARN) that was returned when you called CreateDirectoryRegistration.
    ///   - logger: Logger use during operation
    @inlinable
    public func createServicePrincipalName(
        clientToken: String? = CreateServicePrincipalNameRequest.idempotencyToken(),
        connectorArn: String,
        directoryRegistrationArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = CreateServicePrincipalNameRequest(
            clientToken: clientToken, 
            connectorArn: connectorArn, 
            directoryRegistrationArn: directoryRegistrationArn
        )
        return try await self.createServicePrincipalName(input, logger: logger)
    }

    /// Creates an Active Directory compatible certificate template. The connectors issues certificates using these templates based on the requester’s Active Directory group membership.
    @Sendable
    @inlinable
    public func createTemplate(_ input: CreateTemplateRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateTemplateResponse {
        try await self.client.execute(
            operation: "CreateTemplate", 
            path: "/templates", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Creates an Active Directory compatible certificate template. The connectors issues certificates using these templates based on the requester’s Active Directory group membership.
    ///
    /// Parameters:
    ///   - clientToken: Idempotency token.
    ///   - connectorArn: The Amazon Resource Name (ARN) that was returned when you called CreateConnector.
    ///   - definition: Template configuration to define the information included in certificates. Define certificate validity and renewal periods, certificate request handling and enrollment options, key usage extensions, application policies, and cryptography settings.
    ///   - name: Name of the template. The template name must be unique.
    ///   - tags: Metadata assigned to a template consisting of a key-value pair.
    ///   - logger: Logger use during operation
    @inlinable
    public func createTemplate(
        clientToken: String? = CreateTemplateRequest.idempotencyToken(),
        connectorArn: String,
        definition: TemplateDefinition,
        name: String,
        tags: [String: String]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateTemplateResponse {
        let input = CreateTemplateRequest(
            clientToken: clientToken, 
            connectorArn: connectorArn, 
            definition: definition, 
            name: name, 
            tags: tags
        )
        return try await self.createTemplate(input, logger: logger)
    }

    /// Create a group access control entry. Allow or deny Active Directory groups from enrolling and/or autoenrolling with the template based on the group security identifiers (SIDs).
    @Sendable
    @inlinable
    public func createTemplateGroupAccessControlEntry(_ input: CreateTemplateGroupAccessControlEntryRequest, logger: Logger = AWSClient.loggingDisabled) async throws {
        try await self.client.execute(
            operation: "CreateTemplateGroupAccessControlEntry", 
            path: "/templates/{TemplateArn}/accessControlEntries", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Create a group access control entry. Allow or deny Active Directory groups from enrolling and/or autoenrolling with the template based on the group security identifiers (SIDs).
    ///
    /// Parameters:
    ///   - accessRights:  Allow or deny permissions for an Active Directory group to enroll or autoenroll certificates for a template.
    ///   - clientToken: Idempotency token.
    ///   - groupDisplayName: Name of the Active Directory group. This name does not need to match the group name in Active Directory.
    ///   - groupSecurityIdentifier: Security identifier (SID) of the group object from Active Directory. The SID starts with "S-".
    ///   - templateArn: The Amazon Resource Name (ARN) that was returned when you called CreateTemplate.
    ///   - logger: Logger use during operation
    @inlinable
    public func createTemplateGroupAccessControlEntry(
        accessRights: AccessRights,
        clientToken: String? = CreateTemplateGroupAccessControlEntryRequest.idempotencyToken(),
        groupDisplayName: String,
        groupSecurityIdentifier: String,
        templateArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = CreateTemplateGroupAccessControlEntryRequest(
            accessRights: accessRights, 
            clientToken: clientToken, 
            groupDisplayName: groupDisplayName, 
            groupSecurityIdentifier: groupSecurityIdentifier, 
            templateArn: templateArn
        )
        return try await self.createTemplateGroupAccessControlEntry(input, logger: logger)
    }

    /// Deletes a connector for Active Directory. You must provide the Amazon Resource Name (ARN) of the connector that you want to delete. You can find the ARN by calling the https://docs.aws.amazon.com/pca-connector-ad/latest/APIReference/API_ListConnectors action. Deleting a connector does not deregister your directory with Amazon Web Services Private CA. You can deregister your directory by calling the https://docs.aws.amazon.com/pca-connector-ad/latest/APIReference/API_DeleteDirectoryRegistration action.
    @Sendable
    @inlinable
    public func deleteConnector(_ input: DeleteConnectorRequest, logger: Logger = AWSClient.loggingDisabled) async throws {
        try await self.client.execute(
            operation: "DeleteConnector", 
            path: "/connectors/{ConnectorArn}", 
            httpMethod: .DELETE, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Deletes a connector for Active Directory. You must provide the Amazon Resource Name (ARN) of the connector that you want to delete. You can find the ARN by calling the https://docs.aws.amazon.com/pca-connector-ad/latest/APIReference/API_ListConnectors action. Deleting a connector does not deregister your directory with Amazon Web Services Private CA. You can deregister your directory by calling the https://docs.aws.amazon.com/pca-connector-ad/latest/APIReference/API_DeleteDirectoryRegistration action.
    ///
    /// Parameters:
    ///   - connectorArn:  The Amazon Resource Name (ARN) that was returned when you called CreateConnector.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteConnector(
        connectorArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = DeleteConnectorRequest(
            connectorArn: connectorArn
        )
        return try await self.deleteConnector(input, logger: logger)
    }

    /// Deletes a directory registration. Deleting a directory registration deauthorizes Amazon Web Services Private CA with the directory.
    @Sendable
    @inlinable
    public func deleteDirectoryRegistration(_ input: DeleteDirectoryRegistrationRequest, logger: Logger = AWSClient.loggingDisabled) async throws {
        try await self.client.execute(
            operation: "DeleteDirectoryRegistration", 
            path: "/directoryRegistrations/{DirectoryRegistrationArn}", 
            httpMethod: .DELETE, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Deletes a directory registration. Deleting a directory registration deauthorizes Amazon Web Services Private CA with the directory.
    ///
    /// Parameters:
    ///   - directoryRegistrationArn: The Amazon Resource Name (ARN) that was returned when you called CreateDirectoryRegistration.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteDirectoryRegistration(
        directoryRegistrationArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = DeleteDirectoryRegistrationRequest(
            directoryRegistrationArn: directoryRegistrationArn
        )
        return try await self.deleteDirectoryRegistration(input, logger: logger)
    }

    /// Deletes the service principal name (SPN) used by a connector to authenticate with your Active Directory.
    @Sendable
    @inlinable
    public func deleteServicePrincipalName(_ input: DeleteServicePrincipalNameRequest, logger: Logger = AWSClient.loggingDisabled) async throws {
        try await self.client.execute(
            operation: "DeleteServicePrincipalName", 
            path: "/directoryRegistrations/{DirectoryRegistrationArn}/servicePrincipalNames/{ConnectorArn}", 
            httpMethod: .DELETE, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Deletes the service principal name (SPN) used by a connector to authenticate with your Active Directory.
    ///
    /// Parameters:
    ///   - connectorArn:  The Amazon Resource Name (ARN) that was returned when you called CreateConnector.
    ///   - directoryRegistrationArn: The Amazon Resource Name (ARN) that was returned when you called CreateDirectoryRegistration.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteServicePrincipalName(
        connectorArn: String,
        directoryRegistrationArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = DeleteServicePrincipalNameRequest(
            connectorArn: connectorArn, 
            directoryRegistrationArn: directoryRegistrationArn
        )
        return try await self.deleteServicePrincipalName(input, logger: logger)
    }

    /// Deletes a template. Certificates issued using the template are still valid until they are revoked or expired.
    @Sendable
    @inlinable
    public func deleteTemplate(_ input: DeleteTemplateRequest, logger: Logger = AWSClient.loggingDisabled) async throws {
        try await self.client.execute(
            operation: "DeleteTemplate", 
            path: "/templates/{TemplateArn}", 
            httpMethod: .DELETE, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Deletes a template. Certificates issued using the template are still valid until they are revoked or expired.
    ///
    /// Parameters:
    ///   - templateArn: The Amazon Resource Name (ARN) that was returned when you called CreateTemplate.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteTemplate(
        templateArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = DeleteTemplateRequest(
            templateArn: templateArn
        )
        return try await self.deleteTemplate(input, logger: logger)
    }

    /// Deletes a group access control entry.
    @Sendable
    @inlinable
    public func deleteTemplateGroupAccessControlEntry(_ input: DeleteTemplateGroupAccessControlEntryRequest, logger: Logger = AWSClient.loggingDisabled) async throws {
        try await self.client.execute(
            operation: "DeleteTemplateGroupAccessControlEntry", 
            path: "/templates/{TemplateArn}/accessControlEntries/{GroupSecurityIdentifier}", 
            httpMethod: .DELETE, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Deletes a group access control entry.
    ///
    /// Parameters:
    ///   - groupSecurityIdentifier: Security identifier (SID) of the group object from Active Directory. The SID starts with "S-".
    ///   - templateArn: The Amazon Resource Name (ARN) that was returned when you called CreateTemplate.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteTemplateGroupAccessControlEntry(
        groupSecurityIdentifier: String,
        templateArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = DeleteTemplateGroupAccessControlEntryRequest(
            groupSecurityIdentifier: groupSecurityIdentifier, 
            templateArn: templateArn
        )
        return try await self.deleteTemplateGroupAccessControlEntry(input, logger: logger)
    }

    /// Lists information about your connector. You specify the connector on input by its ARN (Amazon Resource Name).
    @Sendable
    @inlinable
    public func getConnector(_ input: GetConnectorRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetConnectorResponse {
        try await self.client.execute(
            operation: "GetConnector", 
            path: "/connectors/{ConnectorArn}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists information about your connector. You specify the connector on input by its ARN (Amazon Resource Name).
    ///
    /// Parameters:
    ///   - connectorArn:  The Amazon Resource Name (ARN) that was returned when you called CreateConnector.
    ///   - logger: Logger use during operation
    @inlinable
    public func getConnector(
        connectorArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetConnectorResponse {
        let input = GetConnectorRequest(
            connectorArn: connectorArn
        )
        return try await self.getConnector(input, logger: logger)
    }

    /// A structure that contains information about your directory registration.
    @Sendable
    @inlinable
    public func getDirectoryRegistration(_ input: GetDirectoryRegistrationRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetDirectoryRegistrationResponse {
        try await self.client.execute(
            operation: "GetDirectoryRegistration", 
            path: "/directoryRegistrations/{DirectoryRegistrationArn}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// A structure that contains information about your directory registration.
    ///
    /// Parameters:
    ///   - directoryRegistrationArn: The Amazon Resource Name (ARN) that was returned when you called CreateDirectoryRegistration.
    ///   - logger: Logger use during operation
    @inlinable
    public func getDirectoryRegistration(
        directoryRegistrationArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetDirectoryRegistrationResponse {
        let input = GetDirectoryRegistrationRequest(
            directoryRegistrationArn: directoryRegistrationArn
        )
        return try await self.getDirectoryRegistration(input, logger: logger)
    }

    /// Lists the service principal name that the connector uses to authenticate with Active Directory.
    @Sendable
    @inlinable
    public func getServicePrincipalName(_ input: GetServicePrincipalNameRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetServicePrincipalNameResponse {
        try await self.client.execute(
            operation: "GetServicePrincipalName", 
            path: "/directoryRegistrations/{DirectoryRegistrationArn}/servicePrincipalNames/{ConnectorArn}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists the service principal name that the connector uses to authenticate with Active Directory.
    ///
    /// Parameters:
    ///   - connectorArn: The Amazon Resource Name (ARN) that was returned when you called CreateConnector.
    ///   - directoryRegistrationArn: The Amazon Resource Name (ARN) that was returned when you called CreateDirectoryRegistration.
    ///   - logger: Logger use during operation
    @inlinable
    public func getServicePrincipalName(
        connectorArn: String,
        directoryRegistrationArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetServicePrincipalNameResponse {
        let input = GetServicePrincipalNameRequest(
            connectorArn: connectorArn, 
            directoryRegistrationArn: directoryRegistrationArn
        )
        return try await self.getServicePrincipalName(input, logger: logger)
    }

    /// Retrieves a certificate template that the connector uses to issue certificates from a private CA.
    @Sendable
    @inlinable
    public func getTemplate(_ input: GetTemplateRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetTemplateResponse {
        try await self.client.execute(
            operation: "GetTemplate", 
            path: "/templates/{TemplateArn}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Retrieves a certificate template that the connector uses to issue certificates from a private CA.
    ///
    /// Parameters:
    ///   - templateArn: The Amazon Resource Name (ARN) that was returned when you called CreateTemplate.
    ///   - logger: Logger use during operation
    @inlinable
    public func getTemplate(
        templateArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetTemplateResponse {
        let input = GetTemplateRequest(
            templateArn: templateArn
        )
        return try await self.getTemplate(input, logger: logger)
    }

    /// Retrieves the group access control entries for a template.
    @Sendable
    @inlinable
    public func getTemplateGroupAccessControlEntry(_ input: GetTemplateGroupAccessControlEntryRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetTemplateGroupAccessControlEntryResponse {
        try await self.client.execute(
            operation: "GetTemplateGroupAccessControlEntry", 
            path: "/templates/{TemplateArn}/accessControlEntries/{GroupSecurityIdentifier}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Retrieves the group access control entries for a template.
    ///
    /// Parameters:
    ///   - groupSecurityIdentifier: Security identifier (SID) of the group object from Active Directory. The SID starts with "S-".
    ///   - templateArn: The Amazon Resource Name (ARN) that was returned when you called CreateTemplate.
    ///   - logger: Logger use during operation
    @inlinable
    public func getTemplateGroupAccessControlEntry(
        groupSecurityIdentifier: String,
        templateArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetTemplateGroupAccessControlEntryResponse {
        let input = GetTemplateGroupAccessControlEntryRequest(
            groupSecurityIdentifier: groupSecurityIdentifier, 
            templateArn: templateArn
        )
        return try await self.getTemplateGroupAccessControlEntry(input, logger: logger)
    }

    /// Lists the connectors that you created by using the https://docs.aws.amazon.com/pca-connector-ad/latest/APIReference/API_CreateConnector action.
    @Sendable
    @inlinable
    public func listConnectors(_ input: ListConnectorsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListConnectorsResponse {
        try await self.client.execute(
            operation: "ListConnectors", 
            path: "/connectors", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists the connectors that you created by using the https://docs.aws.amazon.com/pca-connector-ad/latest/APIReference/API_CreateConnector action.
    ///
    /// Parameters:
    ///   - maxResults: Use this parameter when paginating results to specify the maximum number of items to return in the response on each page. If additional items exist beyond the number you specify, the NextToken element is sent in the response. Use this NextToken value in a subsequent request to retrieve additional items.
    ///   - nextToken: Use this parameter when paginating results in a subsequent request after you receive a response with truncated results. Set it to the value of the NextToken parameter from the response you just received.
    ///   - logger: Logger use during operation
    @inlinable
    public func listConnectors(
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListConnectorsResponse {
        let input = ListConnectorsRequest(
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listConnectors(input, logger: logger)
    }

    /// Lists the directory registrations that you created by using the https://docs.aws.amazon.com/pca-connector-ad/latest/APIReference/API_CreateDirectoryRegistration action.
    @Sendable
    @inlinable
    public func listDirectoryRegistrations(_ input: ListDirectoryRegistrationsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListDirectoryRegistrationsResponse {
        try await self.client.execute(
            operation: "ListDirectoryRegistrations", 
            path: "/directoryRegistrations", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists the directory registrations that you created by using the https://docs.aws.amazon.com/pca-connector-ad/latest/APIReference/API_CreateDirectoryRegistration action.
    ///
    /// Parameters:
    ///   - maxResults: Use this parameter when paginating results to specify the maximum number of items to return in the response on each page. If additional items exist beyond the number you specify, the NextToken element is sent in the response. Use this NextToken value in a subsequent request to retrieve additional items.
    ///   - nextToken: Use this parameter when paginating results in a subsequent request after you receive a response with truncated results. Set it to the value of the NextToken parameter from the response you just received.
    ///   - logger: Logger use during operation
    @inlinable
    public func listDirectoryRegistrations(
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListDirectoryRegistrationsResponse {
        let input = ListDirectoryRegistrationsRequest(
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listDirectoryRegistrations(input, logger: logger)
    }

    /// Lists the service principal names that the connector uses to authenticate with Active Directory.
    @Sendable
    @inlinable
    public func listServicePrincipalNames(_ input: ListServicePrincipalNamesRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListServicePrincipalNamesResponse {
        try await self.client.execute(
            operation: "ListServicePrincipalNames", 
            path: "/directoryRegistrations/{DirectoryRegistrationArn}/servicePrincipalNames", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists the service principal names that the connector uses to authenticate with Active Directory.
    ///
    /// Parameters:
    ///   - directoryRegistrationArn: The Amazon Resource Name (ARN) that was returned when you called CreateDirectoryRegistration.
    ///   - maxResults: Use this parameter when paginating results to specify the maximum number of items to return in the response on each page. If additional items exist beyond the number you specify, the NextToken element is sent in the response. Use this NextToken value in a subsequent request to retrieve additional items.
    ///   - nextToken: Use this parameter when paginating results in a subsequent request after you receive a response with truncated results. Set it to the value of the NextToken parameter from the response you just received.
    ///   - logger: Logger use during operation
    @inlinable
    public func listServicePrincipalNames(
        directoryRegistrationArn: String,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListServicePrincipalNamesResponse {
        let input = ListServicePrincipalNamesRequest(
            directoryRegistrationArn: directoryRegistrationArn, 
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listServicePrincipalNames(input, logger: logger)
    }

    /// Lists the tags, if any, that are associated with your resource.
    @Sendable
    @inlinable
    public func listTagsForResource(_ input: ListTagsForResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListTagsForResourceResponse {
        try await self.client.execute(
            operation: "ListTagsForResource", 
            path: "/tags/{ResourceArn}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists the tags, if any, that are associated with your resource.
    ///
    /// Parameters:
    ///   - resourceArn: The Amazon Resource Name (ARN) that was returned when you created the resource.
    ///   - logger: Logger use during operation
    @inlinable
    public func listTagsForResource(
        resourceArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListTagsForResourceResponse {
        let input = ListTagsForResourceRequest(
            resourceArn: resourceArn
        )
        return try await self.listTagsForResource(input, logger: logger)
    }

    /// Lists group access control entries you created.
    @Sendable
    @inlinable
    public func listTemplateGroupAccessControlEntries(_ input: ListTemplateGroupAccessControlEntriesRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListTemplateGroupAccessControlEntriesResponse {
        try await self.client.execute(
            operation: "ListTemplateGroupAccessControlEntries", 
            path: "/templates/{TemplateArn}/accessControlEntries", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists group access control entries you created.
    ///
    /// Parameters:
    ///   - maxResults: Use this parameter when paginating results to specify the maximum number of items to return in the response on each page. If additional items exist beyond the number you specify, the NextToken element is sent in the response. Use this NextToken value in a subsequent request to retrieve additional items.
    ///   - nextToken: Use this parameter when paginating results in a subsequent request after you receive a response with truncated results. Set it to the value of the NextToken parameter from the response you just received.
    ///   - templateArn: The Amazon Resource Name (ARN) that was returned when you called CreateTemplate.
    ///   - logger: Logger use during operation
    @inlinable
    public func listTemplateGroupAccessControlEntries(
        maxResults: Int? = nil,
        nextToken: String? = nil,
        templateArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListTemplateGroupAccessControlEntriesResponse {
        let input = ListTemplateGroupAccessControlEntriesRequest(
            maxResults: maxResults, 
            nextToken: nextToken, 
            templateArn: templateArn
        )
        return try await self.listTemplateGroupAccessControlEntries(input, logger: logger)
    }

    /// Lists the templates, if any, that are associated with a connector.
    @Sendable
    @inlinable
    public func listTemplates(_ input: ListTemplatesRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListTemplatesResponse {
        try await self.client.execute(
            operation: "ListTemplates", 
            path: "/templates", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists the templates, if any, that are associated with a connector.
    ///
    /// Parameters:
    ///   - connectorArn: The Amazon Resource Name (ARN) that was returned when you called CreateConnector.
    ///   - maxResults: Use this parameter when paginating results to specify the maximum number of items to return in the response on each page. If additional items exist beyond the number you specify, the NextToken element is sent in the response. Use this NextToken value in a subsequent request to retrieve additional items.
    ///   - nextToken: Use this parameter when paginating results in a subsequent request after you receive a response with truncated results. Set it to the value of the NextToken parameter from the response you just received.
    ///   - logger: Logger use during operation
    @inlinable
    public func listTemplates(
        connectorArn: String,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListTemplatesResponse {
        let input = ListTemplatesRequest(
            connectorArn: connectorArn, 
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listTemplates(input, logger: logger)
    }

    /// Adds one or more tags to your resource.
    @Sendable
    @inlinable
    public func tagResource(_ input: TagResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws {
        try await self.client.execute(
            operation: "TagResource", 
            path: "/tags/{ResourceArn}", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Adds one or more tags to your resource.
    ///
    /// Parameters:
    ///   - resourceArn: The Amazon Resource Name (ARN) that was returned when you created the resource.
    ///   - tags: Metadata assigned to a directory registration consisting of a key-value pair.
    ///   - logger: Logger use during operation
    @inlinable
    public func tagResource(
        resourceArn: String,
        tags: [String: String],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = TagResourceRequest(
            resourceArn: resourceArn, 
            tags: tags
        )
        return try await self.tagResource(input, logger: logger)
    }

    /// Removes one or more tags from your resource.
    @Sendable
    @inlinable
    public func untagResource(_ input: UntagResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws {
        try await self.client.execute(
            operation: "UntagResource", 
            path: "/tags/{ResourceArn}", 
            httpMethod: .DELETE, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Removes one or more tags from your resource.
    ///
    /// Parameters:
    ///   - resourceArn: The Amazon Resource Name (ARN) that was returned when you created the resource.
    ///   - tagKeys: Specifies a list of tag keys that you want to remove from the specified resources.
    ///   - logger: Logger use during operation
    @inlinable
    public func untagResource(
        resourceArn: String,
        tagKeys: [String],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = UntagResourceRequest(
            resourceArn: resourceArn, 
            tagKeys: tagKeys
        )
        return try await self.untagResource(input, logger: logger)
    }

    /// Update template configuration to define the information included in certificates.
    @Sendable
    @inlinable
    public func updateTemplate(_ input: UpdateTemplateRequest, logger: Logger = AWSClient.loggingDisabled) async throws {
        try await self.client.execute(
            operation: "UpdateTemplate", 
            path: "/templates/{TemplateArn}", 
            httpMethod: .PATCH, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Update template configuration to define the information included in certificates.
    ///
    /// Parameters:
    ///   - definition: Template configuration to define the information included in certificates. Define certificate validity and renewal periods, certificate request handling and enrollment options, key usage extensions, application policies, and cryptography settings.
    ///   - reenrollAllCertificateHolders: This setting allows the major version of a template to be increased automatically. All members of Active Directory groups that are allowed to enroll with a template will receive a new certificate issued using that template.
    ///   - templateArn: The Amazon Resource Name (ARN) that was returned when you called CreateTemplate.
    ///   - logger: Logger use during operation
    @inlinable
    public func updateTemplate(
        definition: TemplateDefinition? = nil,
        reenrollAllCertificateHolders: Bool? = nil,
        templateArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = UpdateTemplateRequest(
            definition: definition, 
            reenrollAllCertificateHolders: reenrollAllCertificateHolders, 
            templateArn: templateArn
        )
        return try await self.updateTemplate(input, logger: logger)
    }

    /// Update a group access control entry you created using CreateTemplateGroupAccessControlEntry.
    @Sendable
    @inlinable
    public func updateTemplateGroupAccessControlEntry(_ input: UpdateTemplateGroupAccessControlEntryRequest, logger: Logger = AWSClient.loggingDisabled) async throws {
        try await self.client.execute(
            operation: "UpdateTemplateGroupAccessControlEntry", 
            path: "/templates/{TemplateArn}/accessControlEntries/{GroupSecurityIdentifier}", 
            httpMethod: .PATCH, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Update a group access control entry you created using CreateTemplateGroupAccessControlEntry.
    ///
    /// Parameters:
    ///   - accessRights: Allow or deny permissions for an Active Directory group to enroll or autoenroll certificates for a template.
    ///   - groupDisplayName: Name of the Active Directory group. This name does not need to match the group name in Active Directory.
    ///   - groupSecurityIdentifier: Security identifier (SID) of the group object from Active Directory. The SID starts with "S-".
    ///   - templateArn: The Amazon Resource Name (ARN) that was returned when you called CreateTemplate.
    ///   - logger: Logger use during operation
    @inlinable
    public func updateTemplateGroupAccessControlEntry(
        accessRights: AccessRights? = nil,
        groupDisplayName: String? = nil,
        groupSecurityIdentifier: String,
        templateArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = UpdateTemplateGroupAccessControlEntryRequest(
            accessRights: accessRights, 
            groupDisplayName: groupDisplayName, 
            groupSecurityIdentifier: groupSecurityIdentifier, 
            templateArn: templateArn
        )
        return try await self.updateTemplateGroupAccessControlEntry(input, logger: logger)
    }
}

extension PcaConnectorAd {
    /// Initializer required by `AWSService.with(middlewares:timeout:byteBufferAllocator:options)`. You are not able to use this initializer directly as there are not public
    /// initializers for `AWSServiceConfig.Patch`. Please use `AWSService.with(middlewares:timeout:byteBufferAllocator:options)` instead.
    public init(from: PcaConnectorAd, patch: AWSServiceConfig.Patch) {
        self.client = from.client
        self.config = from.config.with(patch: patch)
    }
}

// MARK: Paginators

@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
extension PcaConnectorAd {
    /// Return PaginatorSequence for operation ``listConnectors(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listConnectorsPaginator(
        _ input: ListConnectorsRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListConnectorsRequest, ListConnectorsResponse> {
        return .init(
            input: input,
            command: self.listConnectors,
            inputKey: \ListConnectorsRequest.nextToken,
            outputKey: \ListConnectorsResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listConnectors(_:logger:)``.
    ///
    /// - Parameters:
    ///   - maxResults: Use this parameter when paginating results to specify the maximum number of items to return in the response on each page. If additional items exist beyond the number you specify, the NextToken element is sent in the response. Use this NextToken value in a subsequent request to retrieve additional items.
    ///   - logger: Logger used for logging
    @inlinable
    public func listConnectorsPaginator(
        maxResults: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListConnectorsRequest, ListConnectorsResponse> {
        let input = ListConnectorsRequest(
            maxResults: maxResults
        )
        return self.listConnectorsPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listDirectoryRegistrations(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listDirectoryRegistrationsPaginator(
        _ input: ListDirectoryRegistrationsRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListDirectoryRegistrationsRequest, ListDirectoryRegistrationsResponse> {
        return .init(
            input: input,
            command: self.listDirectoryRegistrations,
            inputKey: \ListDirectoryRegistrationsRequest.nextToken,
            outputKey: \ListDirectoryRegistrationsResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listDirectoryRegistrations(_:logger:)``.
    ///
    /// - Parameters:
    ///   - maxResults: Use this parameter when paginating results to specify the maximum number of items to return in the response on each page. If additional items exist beyond the number you specify, the NextToken element is sent in the response. Use this NextToken value in a subsequent request to retrieve additional items.
    ///   - logger: Logger used for logging
    @inlinable
    public func listDirectoryRegistrationsPaginator(
        maxResults: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListDirectoryRegistrationsRequest, ListDirectoryRegistrationsResponse> {
        let input = ListDirectoryRegistrationsRequest(
            maxResults: maxResults
        )
        return self.listDirectoryRegistrationsPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listServicePrincipalNames(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listServicePrincipalNamesPaginator(
        _ input: ListServicePrincipalNamesRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListServicePrincipalNamesRequest, ListServicePrincipalNamesResponse> {
        return .init(
            input: input,
            command: self.listServicePrincipalNames,
            inputKey: \ListServicePrincipalNamesRequest.nextToken,
            outputKey: \ListServicePrincipalNamesResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listServicePrincipalNames(_:logger:)``.
    ///
    /// - Parameters:
    ///   - directoryRegistrationArn: The Amazon Resource Name (ARN) that was returned when you called CreateDirectoryRegistration.
    ///   - maxResults: Use this parameter when paginating results to specify the maximum number of items to return in the response on each page. If additional items exist beyond the number you specify, the NextToken element is sent in the response. Use this NextToken value in a subsequent request to retrieve additional items.
    ///   - logger: Logger used for logging
    @inlinable
    public func listServicePrincipalNamesPaginator(
        directoryRegistrationArn: String,
        maxResults: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListServicePrincipalNamesRequest, ListServicePrincipalNamesResponse> {
        let input = ListServicePrincipalNamesRequest(
            directoryRegistrationArn: directoryRegistrationArn, 
            maxResults: maxResults
        )
        return self.listServicePrincipalNamesPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listTemplateGroupAccessControlEntries(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listTemplateGroupAccessControlEntriesPaginator(
        _ input: ListTemplateGroupAccessControlEntriesRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListTemplateGroupAccessControlEntriesRequest, ListTemplateGroupAccessControlEntriesResponse> {
        return .init(
            input: input,
            command: self.listTemplateGroupAccessControlEntries,
            inputKey: \ListTemplateGroupAccessControlEntriesRequest.nextToken,
            outputKey: \ListTemplateGroupAccessControlEntriesResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listTemplateGroupAccessControlEntries(_:logger:)``.
    ///
    /// - Parameters:
    ///   - maxResults: Use this parameter when paginating results to specify the maximum number of items to return in the response on each page. If additional items exist beyond the number you specify, the NextToken element is sent in the response. Use this NextToken value in a subsequent request to retrieve additional items.
    ///   - templateArn: The Amazon Resource Name (ARN) that was returned when you called CreateTemplate.
    ///   - logger: Logger used for logging
    @inlinable
    public func listTemplateGroupAccessControlEntriesPaginator(
        maxResults: Int? = nil,
        templateArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListTemplateGroupAccessControlEntriesRequest, ListTemplateGroupAccessControlEntriesResponse> {
        let input = ListTemplateGroupAccessControlEntriesRequest(
            maxResults: maxResults, 
            templateArn: templateArn
        )
        return self.listTemplateGroupAccessControlEntriesPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listTemplates(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listTemplatesPaginator(
        _ input: ListTemplatesRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListTemplatesRequest, ListTemplatesResponse> {
        return .init(
            input: input,
            command: self.listTemplates,
            inputKey: \ListTemplatesRequest.nextToken,
            outputKey: \ListTemplatesResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listTemplates(_:logger:)``.
    ///
    /// - Parameters:
    ///   - connectorArn: The Amazon Resource Name (ARN) that was returned when you called CreateConnector.
    ///   - maxResults: Use this parameter when paginating results to specify the maximum number of items to return in the response on each page. If additional items exist beyond the number you specify, the NextToken element is sent in the response. Use this NextToken value in a subsequent request to retrieve additional items.
    ///   - logger: Logger used for logging
    @inlinable
    public func listTemplatesPaginator(
        connectorArn: String,
        maxResults: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListTemplatesRequest, ListTemplatesResponse> {
        let input = ListTemplatesRequest(
            connectorArn: connectorArn, 
            maxResults: maxResults
        )
        return self.listTemplatesPaginator(input, logger: logger)
    }
}

extension PcaConnectorAd.ListConnectorsRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> PcaConnectorAd.ListConnectorsRequest {
        return .init(
            maxResults: self.maxResults,
            nextToken: token
        )
    }
}

extension PcaConnectorAd.ListDirectoryRegistrationsRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> PcaConnectorAd.ListDirectoryRegistrationsRequest {
        return .init(
            maxResults: self.maxResults,
            nextToken: token
        )
    }
}

extension PcaConnectorAd.ListServicePrincipalNamesRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> PcaConnectorAd.ListServicePrincipalNamesRequest {
        return .init(
            directoryRegistrationArn: self.directoryRegistrationArn,
            maxResults: self.maxResults,
            nextToken: token
        )
    }
}

extension PcaConnectorAd.ListTemplateGroupAccessControlEntriesRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> PcaConnectorAd.ListTemplateGroupAccessControlEntriesRequest {
        return .init(
            maxResults: self.maxResults,
            nextToken: token,
            templateArn: self.templateArn
        )
    }
}

extension PcaConnectorAd.ListTemplatesRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> PcaConnectorAd.ListTemplatesRequest {
        return .init(
            connectorArn: self.connectorArn,
            maxResults: self.maxResults,
            nextToken: token
        )
    }
}
